package main.java.反射6;

import java.util.HashMap;
import java.util.List;

/**
 * @Auther:Liu
 * @Testname:Test
 * @Date:2025/3/14 10:11
 */
public class Test {
    public static void main(String[] args) throws Exception {
//        //插入
//        int q = Myjdbc.insert("insert into manage values(?,?,null)", "赵文哲", "1245");
//        System.out.println(q);
        //删除
//        int q = Myjdbc.insert("delete from manage where id=?", "10");
//        System.out.println(q);

        //更新
//        int w=Myjdbc.insert("update manage set admire=?,password=? where id=?","王晓婷","12341","14");
//        System.out.println(w);

        //查找
//        Object findone = Myjdbc.findone("select * from manage where id=?", Manage.class, 3);
//        System.out.println(findone);

        //查找(all)
        List<Manage> q = Myjdbc.findall("select * from manage where admire=?", Manage.class, "王晓婷");
        System.out.println(q);

//        //键值对获取一条
//        HashMap<String, Object> findmap = Myjdbc.findmap("select * from manage where id=?", 2);
//        System.out.println(findmap);

//        //键值对获取多条
//        ArrayList<Map> findmaps = Myjdbc.findmaps("select * from manage where password=?", "12341");
//        System.out.println(findmaps);

        //数组获取一条
//        Object[] findshu = Myjdbc.findshu("select * from manage where id=?", 1);
////        for (int i = 0; i < findshu.length ; i++) {
//            System.out.println(Arrays.toString(findshu));
////        }

        //返回多条数据
//        ArrayList<Object[]> findshus = Myjdbc.findshus("select * from manage where password=?", "12341");
//        for (int i = 0; i < findshus.size() ; i++) {
//            System.out.println(Arrays.toString(findshus.get(i)));
//        }



    }
}
